package com.platform.core.web.controller;

import com.platform.core.service.NcloudSysComponentBiz;
import com.platform.dto.NcloudSysComponentDto;
import com.querydsl.core.BooleanBuilder;
import com.platform.comm.web.results.PageListJsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Map;
import static com.platform.core.web.controller.BaseController.getPageable;

/**
 * Description: ncloud_sys_component-管理接口
 *
 * @author Coder
 */
@RestController
@RequestMapping(name = "ncloud_sys_component管理", path = "/management/sysComponent")
public class SysComponentController {

    private final NcloudSysComponentBiz ncloudSysComponentBiz;

    @Autowired
    public SysComponentController(NcloudSysComponentBiz ncloudSysComponentBiz) {
        this.ncloudSysComponentBiz = ncloudSysComponentBiz;
    }

    /**
     * 分页查询ncloud_sys_component数据
     */
    @PostMapping(name = "查询ncloud_sys_component列表", path = "/search")
    public PageListJsonResult<NcloudSysComponentDto> search(@RequestBody Map<String,String> map) {
        Page<NcloudSysComponentDto> entities = ncloudSysComponentBiz.search(new BooleanBuilder(), getPageable(map));
        return new PageListJsonResult<>(entities);
    }

}
